Piped Text
About Piped Text
With piped text, you can customize question and answer choice wording for each respondent, allowing each of them to have a customized, dynamic, and personal survey experience. Piped text is a line of code you add to your survey that pulls information from different sources and displays that information to the respondent (or can be used in display logic, embedded data, and other areas).
Though piped text appears as a line of code in your survey editor, when respondents take the survey, this code will be replaced with the specified content.
Accessing the Piped Text Menu
Piped text is generated using the Piped Text menu. This menu is found in many different places throughout Qualtrics.
- Questions: Click the question text and click the blue Piped Text button.
- Answer Choices: Click the answer choice text, then click the blue dropdown menu and select Insert Piped Text.
- Rich Content Editor: Click the {A} icon in the rich content editor located in many places throughout Qualtrics, such as when editing a question, writing an email, or creating other survey messages.
- Embedded Data: When adding embedded data to the survey flow, click Set a Value Now, then click the blue dropdown menu and select Insert Piped Text.
Generating Piped Text
- In the Piped Text menu, choose which type of piped text you want and specify the particular item you would like to insert.
- Notice that the piped text is inserted into your survey, as shown by a code surrounded by a dollar sign and brackets.
- Place the piped text where you want the actual text to appear in the question.
Piping from a Previous Question
The Survey Question category in the piped text list allows you to pipe information such as the question’s text, a selected answer choice, and more.
To generate Piped Text from a question
- Open the Piped Text menu.
- Select Survey Question.
- Select the question to pipe from.
- Select the specific content from the question that you would like to pipe. We’ll go into detail on what each of these selections means below.
Possible Values for Text Piped from a Question
In step 4 of the above example, you’ll notice a number of possible values that can be piped into your survey.
- Question Text: Pipes the question a respondent sees when taking the survey.
- Description: Refers to previous answer choice text. For example, if they select “Less than 1 month – Description,” the piped text would bring in “Less than 1 month.”
- Text Entry: Pipes any text a respondent enters. For example, if your respondent picks “Other” and types in “Three Years,” the “Other (Text Entry)” piped text would bring forward “Three Years.”
- All Choices – Displayed & Hidden: Pipes in every single answer choice in the question.
- Displayed Choices: Pipes in only the choices the respondent saw. See our page on adding display logic to answer choices for more information on hiding and revealing choices to respondents.
- Not Displayed Choices: Pipes in only the choices the respondent didn’t see. See our page on adding display logic to answer choices for more information on hiding and revealing choices to respondents.
- Selected Choices: Pipes in only the choices the respondent selected.
- Unselected Choices: Pipes in all the choices the respondent didn’t select.
- Selected Choices Recode: Pipes in the recode value assigned to any selected choice.
- Entered Text: Pipes in the text that the respondent entered in an answer choice text box.
- File Size: Pipes in the size of the file the respondent uploaded in a previous file upload question.
- File URL: Pipes in the link to the file the respondent uploaded in a previous file upload question.
- File Name: Pipes in the name of the file the respondent uploaded in a previous file upload question.
Piping from an Embedded Data Field
Embedded data fields allow you to store information about a respondent without actually asking a question, and that information can be piped into later sections of your survey or used in your data analyses.
To generate Piped Text from an Embedded Data field
- Open the Piped Text menu.
- Choose Embedded Data Field.
- Click the dropdown arrow to see a list of the embedded data saved in your survey flow.
- Select the embedded data you wish to insert.
- When finished, click Insert to generate the piped text.
The Importance of Survey Flow Order
Earlier, we mentioned that when you pipe text from a previous question into a following question, you need to be careful of the order content appears, and of page breaks. These same rules apply when working with embedded data.
When putting your embedded data element in the survey flow, think carefully about the order of elements. If your embedded data is not reliant on the respondent answering questions to determine a value, it’s generally best practice to make sure the embedded data is at the top of the survey flow, so it is saved before the respondent reaches any piped text you have displayed.
If the embedded data is reliant on the respondent answering certain questions before it can generate a value (as with math operations), then those questions need to appear in a block before the embedded data is set in the survey flow, and the questions where the embedded data is piped in and displayed to respondents must appear after the embedded data element. You may need to move questions to new blocks to achieve this.
A separation between 2 different blocks is automatically considered a page break.
For additional questions regarding embedded data, see Best Practices and Troubleshooting Embedded Data.
Piping from a GeoIP Location
By default, Qualtrics will record the IP address of the respondent as they enter the survey. Based on their recorded IP address, Qualtrics will calculate their geographical location down to the zip code.
To generate Piped Text from a GeoIP Location
Piping from a Scoring Category
The scoring feature allows you to attach point values to each question answer. Qualtrics allows you to pipe in the following for each scoring category:
- Score: Total score, or the sum of all points a respondent earned in this category.
- Items: The number of scored items the respondent answered.
- Weighted Mean: A mean that excludes blank or unanswered values. Good for comparing scoring categories that add up to different total points.
- Weighted Standard Deviation: A standard deviation that ignores blank or unanswered values.
To generate Piped Text from a Scoring Category
Piping Date / Time
Through the date / time piped text, you can display the current date and time in your survey, as well as other dates. This is useful to display in event registration surveys as a time reference for your respondents.
The time zone of date / time piped text is based off the time zone set in your account when the response was submitted. If you adjust the time zone in your account after responses are submitted, the data collected will not change.
To generate Piped Text for Date / Time
Examples of Piped Text for Current Date and Time
This is not an exhaustive list of date and time piped text formats. If a format you want isn’t listed here, make sure to follow the steps above to open the piped text menu.
Current Date Piped Text:
In the table below, “M” stands for month, “D” stands for day, and “Y” stands for year. “Leading zeroes” are zeroes that appear at the beginning of a number; for example, 03 instead of 3.
Format | Example | Piped Text |
MM/DD/YY (leading zeroes excluded) | 3/14/2024 | ${date://CurrentDate/SL} |
YYYY-MM-DD (leading zeroes excluded) | 2024-3-14 | ${date://CurrentDate/DS} |
MM/DD/YYYY (leading zeroes included) | 03/14/2024 | ${date://CurrentDate/m%2Fd%2FY} |
DD/MM/YYYY (leading zeroes included) | 14/03/2024 | ${date://CurrentDate/d%2Fm%2FY} |
YYYY/MM/DD (leading zeroes included) | 2024/03/14 | ${date://CurrentDate/Y%2Fm%2Fd} |
DD Abbreviated month YYYY | 14 Mar 2024 | ${date://CurrentDate/PT} |
Full month name DD, YYYY | March 14, 2024 | ${date://CurrentDate/FL} |
Day of the week, Full month name DD | Thursday, March 14 | ${date://CurrentDate/DM} |
Full ISO-8601 Format | 2024-03-14T20:27:33.216Z | ${date://CurrentDate/c} |
There is no piped text for the name of the current weekday alone. (For example, just “Thursday.”) However, you can show a combination of the day of the week and the date. See table above.
Current Time Piped Text:
Format | Example | Piped Text |
12 hour clock, capitalized AM / PM | 1:27 PM | ${date://CurrentTime/ST} |
12 hour clock, lowercase am / pm with no space after time | 1:27pm | ${date://CurrentTime/TL} |
24 hour clock | 13:27 | ${date://CurrentTime/MT} |
24 hour clock with seconds | 13:27:33 | ${date://CurrentTime/MS} |
Locale
You can change the language date / time piped text is recorded in. At the end of the piped text, but inside the last bracket, include a question mark ( ? ), the word locale, and set it equal to a language code of your choosing.
?locale=EN
For example, ${date://CurrentDate/DM?locale=FR} would give you the current date in French.
Locale does not affect the time zone of the data recorded.
Piping from a Contact List Field
If you are sending your survey to a contact list (also sometimes known as a panel), you can pipe information from that contact list into your survey or email invitation. These fields include basic information like first name, last name, and email, as well as the specialty fields External Data Reference and Language.
Any custom fields you’ve added to the contact list beyond these standard fields are stored as embedded data and can be piped in using the steps described in the Piping from an Embedded Data Field section.
To generate Piped Text from a Contact List field
Piping from a Loop & Merge field
With loop & merge, you can repeat a series of questions for a respondent that asks about a different item each time. Piped text is critical for loop & merge so that the respondent knows which item they are responding about.
To generate Piped Text from a Loop & Merge field
- Make sure loop & merge is turned on in the same block as the question. Visit the linked support page for more details on how to set this up.
- Navigate to your question and open the Piped Text menu.
- Select Loop & Merge.
- Hover over Loop & Merge Fields.
- Select the desired Loop & Merge Field.
Piping from a Quota
With quotas, you can make sure that you only gather the right amount of data required for your study. Using piped text, you can display three pieces of information about your quota:
- Count: The current number of responses that have incremented your quota.
- Has Not Been Met: Whether the quota has not been met (returns a 1 if true).
- Has Been Met: Whether the quota has been met (returns a 1 if true).
To generate Piped Text from a Quota
- Make sure you have at least 1 quota set up in your survey. Visit the linked support page for more details on how to set this up.
- Navigate to your question and open the Piped Text menu.
- Select Quota.
- Choose the quota to pipe from.
- Select either the current quota count or whether the quota has been met or not.
Random Number Generator
Piped text can be used to generate and display a random number to each of your respondents. When in the survey editor, it will appear as a line of code just like all other piped text. The algorithm that Qualtrics uses for randomization is called the Mersenne Twister.
When respondents take the survey, this code will be replaced with a random number.
There are 3 types of random numbers that you can generate:
- Random Integer: A random whole number.
- Decimal: Float. A random number with 13 decimal places.
- True/False: Boolean. A 0 or 1 selected at random.
To generate a random number
- Open the Piped Text menu.
- Select Random Number.
- Select Integer, Decimal, or True/False.
- Enter a minimum.
- Enter a maximum.
- Click Insert.
Then, return to your survey editor and pipe the embedded data into your question to display it to the respondent.
Piped Text in Different Project Types
Piped text is available in just about every types of project where you customize a survey. The options described on this page are available in:
Piped text can also be used in 360 projects, although there are additional options exclusive to 360. Learn more on the 360 piped text page.